/*
 * @ProjectName: 编程学习
 * @Copyright:   2019 HangZhou Yi Dev, Ltd. All Right Reserved.
 * @address:     https://yiyuery.github.io/
 * @date:        2019/5/20 20:57
 * @email:       xiazhaoyang@live.com
 * @description: 本内容仅限于编程技术学习使用，转发请注明出处.
 */
package com.example.common.ext.map;

import com.google.common.collect.Maps;

import java.util.Map;

/**
 * <p>
 *  MapBuilder.<String,Object>maps()
*             .put("toc","left")
*             .build()
 * </p>
 *
 * @author Yi
 * @version v1.0.0
 * @date 2019-06-07 10:59
 * @modificationHistory=========================逻辑或功能性重大变更记录
 * @modify By: {修改人} 2019-06-07
 * @modify reason: {方法名}:{原因}
 * ...
 */
public class MapBuilder<K,V> {

    private  Map<K, V> holder = Maps.newHashMap();

    private MapBuilder() {
    }

    public static <K,V> MapBuilder<K,V> maps() {
        return new MapBuilder<K,V>();
    }

    public MapBuilder<K,V> put(K k,V v){
        holder.put(k,v);
        return this;
    }

    public Map<K, V> build(){
        return holder;
    }

}
